@(settings: List[Setting])

@css = {
	<link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/settings/list.min.css")" />
}

@main("Settings", css) {

	@helper.form(action = routes.Settings.updateSettings()) {
	
		<table class="settings-list">
			<tr>
				<th class="setting-name">Name</th>
				<th class="setting-value">Value</th>
				<th class="setting-description">Description</th>
			</tr>
			@for(setting <- settings) {
				<tr>
					<td class="setting-name">@setting.getName()</td>
					<td class="setting-value">
						@{setting.getType() match { 
							case SettingType.Boolean =>  
								views.html.settings.controls.boolean(setting)
							case SettingType.Float =>
								views.html.settings.controls.float(setting)
							case SettingType.Integer =>
								views.html.settings.controls.int(setting)
							case SettingType.String =>
								views.html.settings.controls.string(setting)
						}}
					</td>
					<td class="setting-description">@setting.getDescription()</td>
				</tr>
			}
			<tr>
				<td></td>
				<td colspan="2">
					<input type="submit" value="Update settings" />
				</td>
			</tr>
		</table>
		
	}

}
